﻿using UnityEngine;
using System.Collections;

public class ExplosionBehavior : MonoBehaviour {

	float scale;
    float startTime;

	// Use this for initialization
	void Start () {
		scale = 0.05f;
        startTime = Time.time;
        this.transform.localScale = new Vector3(scale, scale, 1);
        audio.Play();
	}
	
	// Update is called once per frame
	void Update () {
        float currentTime = Time.time;

        if (transform.localScale.x < 1)
        {
            this.transform.localScale += new Vector3(scale, scale, 1);
        }

        if (currentTime - startTime > 1.25)
        {
			--(GameManager.numProjectiles);
            Destroy(this.gameObject);
        }
	}
}
